﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>重置密码-微街秀管理后台</title>
<link href="../../Client/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
<link href="../css/admin.css" rel="stylesheet" type="text/css" />
<script src="../js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="../js/function.js" type="text/javascript"></script>
<script src="../js/base.js" type="text/javascript"></script>
<script src="../js/dialog.js" type="text/javascript"></script>
<script src="../js/jquery-form.js" type="text/javascript"></script>
<script src="../js/ajax-data.js" type="text/javascript"></script>
</head>
<body>
<div class="navigation"><a href="javascript:history.go(-1);" class="back">后退</a>首页 &gt; 会员管理 &gt; 重置密码</div>
<div id="contentTab">
    <ul class="tab_nav">
        <li class="selected"><a onclick="tabs('#contentTab',0);" href="javascript:;">重置密码</a></li>     
    </ul>

    <div class="tab_con" style="display:block;">
        <table class="form_table">
            <col width="150px"><col>
            <tbody>
             <tr>
                <th>微街秀ID：</th>
                <td>
                   <span id="id"></span>
                </td>
            </tr>
            <tr>
                <th>用户名：</th>
                <td>
                   <input type="text" id="name" name="name" /> <label>*登录的用户名，支持中文。</label>
                </td>
            </tr>
            <tr>
                <th>密 码：</th>
                <td><input type="text" id="pwd" name="pwd" value="" /> <label>*登录的密码，建议数字和字母的混合。</label></td>
            </tr>
             <tr>
                <th>确认密码：</th>
                <td><input type="text" id="pwd2" name="pwd2" value="" /> <label>*确认的密码，与上面的密码相同。</label></td>
            </tr>

            </tbody>
        </table>
    </div>
    <div class="foot_btn_box" style=" text-align:left; margin-left:150px;">
        <input type="button" class="btnSubmit" value="提交保存" onclick="submits()" />
        <input type="button" class="btnSubmit" value="返回列表" style="margin-left:20px;" onclick="javascript:document.location.href='list.html'" />
    </div>
</div>
<script>
    $(function () {
        islogin();
        GetList(1);
    })

    function GetList(page) {
        if (getQueryString("id") == null) {
            Alert("参数无效")
            return;
        }
        var param = "user_id=" + getQueryString("id");
        AjaxStart("../ajax/user.ashx?GetDetail", param, function (data) {
            if (data.code != 0) {
                alert(data.msg);
            }
            else {
                var item = data.item;
                $("#id").html(item["id"]);
                $("#name").val(item["name"]);
            }
        });
    }

    function submits() {
        if (getQueryString("id") == null) {
            Alert("参数无效")
            return;
        }
        var pwd = $("#pwd").val();
        var pwd2 = $("#pwd2").val();

        if (pwd == "") {
            Alert("请输入密码");
            return;
        }
        if (pwd2 == "") {
            Alert("请输入确认密码");
            return;
        }
        if (pwd != pwd2) {
            Alert("两次输入的密码不一致")
            return;
        }

        var param = "user_id=" + getQueryString("id") + "&pwd=" + pwd + "&pwd2=" + pwd2;
        AjaxStart("../ajax/user.ashx?editpwd", param, function (data) {
            if (data.code != 0)
                Alert(data.msg);
            else
                Alert("修改成功")
        });
    }
</script>
</body>
</html>
